package com.chagee.store.operation.server.model.bo;

import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.poi.ss.formula.functions.T;

import java.io.Serializable;
import java.util.List;

/**
 * @Author : hk
 * @Date : 2024/12/11
 */

@Data
@Accessors(chain = true)
public class FeiShuTableBO implements Serializable {

	private String tag;

	private Integer page_size;

	private String row_height;

	private Boolean freeze_first_column;

	private HeaderStyle header_style;

	//列头
	private List<Object> columns;

	//数据
	private List<Object> rows;

//	public FeiShuTableBO(List<String> columns, List<Object> rows) {
//		this.tag = "table";
//		this.page_size = 10;
//		this.row_height = "low";
//		this.freeze_first_column = true;
//		this.header_style = getHeaderStyle();
//		this.columns = columns;
//		this.rows = rows;
//	}

	public FeiShuTableBO() {
		this.tag = "table";
		this.page_size = 10;
		this.row_height = "low";
		this.freeze_first_column = true;
		this.header_style = getHeaderStyle();
	}

	/**
	 * 设置表头
	 */
	@Data
	@Accessors(chain = true)
	public static class HeaderStyle implements Serializable {

		// 文本对齐方式
		private String text_align;

		// 字号
		private String text_size;

		// 背景色
		private String background_style;

		// 文本颜色
		private String text_color;

		// 是否加粗
		private Boolean bold;

		// 文本行数 默认值 1
		private Integer lines;

	}

	public HeaderStyle getHeaderStyle () {
		return new HeaderStyle().setText_align("left").setText_size("normal").setBackground_style("none").setText_color("grey").setBold(true).setLines(1);
	}

}
